package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
	"strings"
)

func hello(w http.ResponseWriter, r *http.Request) {
	r.ParseForm()
	//fmt.Println(r.Form)
	fmt.Println(r.URL.Path)
	//fmt.Println(r.URL.Scheme)

	for k, v := range r.Form {
		fmt.Printf("key: %s val: %s \n", k, strings.Join(v, " "))
		//fmt.Println("val:", strings.Join(v, " "))
	}
	io.WriteString(w, "hello world!!!")

}

func main() {
	http.HandleFunc("/", hello)
	err := http.ListenAndServe(":8000", nil)
	if err != nil {
		log.Fatal("ListenAndServe: ", err)
	}
}
